%:- ensure_loaded('ProductionSystem.pl').
load_library('ProductionSystem.pl').

:- arithmetic_function(ranf/0).

ranf(X, N) :-     
	% N =  65536,
	% X is random(N) returns a 
        % random number from 0 .. N-1
	X is random(N)/N.

draw_polygon(Owner,Id, CoordinateList, (R, G, B), Texture):-
	assert(polygon(Id, CoordinateList, (R, G, B), Texture, layer)),
	assert(polygonOwner(Owner,Id)).
	
tesla(Y):-
	assert(polygon(Y,[(1,1), (1,400), (400,400), (400,1)],(0,250,0), no_texture, layer)).
testla(X):-
	assert(polygon(X,[(1,1), (1,200), (200,200), (200,1)],(250,0,0), no_texture, layer)).
		
/*
*Just to see if it's working.
*if ( isAwake(lucifer) ) then ( java_object('javax.swing.JFrame', [], Aviso),
*								Aviso <- setVisible(true)).
*/
if ( isAwake(lucifer) ) then ( retract(isAwake(lucifer)),  tesla(lucifer2)).

	


